<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box1{
            width: 200px;
            height: 200px;
            background-color: pink;
        }



    </style>
</head>

<body>

    <div class="box">
        <p class="p"> 点我这段文字</p>

        <div class="box1">
            
        </div>

    </div>

    <script>
        var p=document.querySelector('p');
        var box=document.querySelector('.box');
        var box1=document.querySelector('.box1');

        p.onclick=function(){
        
        box.style.display='none'

        }


    </script>
</body>

</html>